package xxy.com.yangproject.ui.activity;

import androidx.databinding.DataBindingUtil;
import androidx.navigation.Navigation;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import java.util.ArrayList;

import xxy.com.yangproject.BaseActivity;
import xxy.com.yangproject.R;
import xxy.com.yangproject.databinding.ActivityMain4Binding;
import xxy.com.yangproject.model.NbaBean;

public class Main4Activity extends BaseActivity {

    private ActivityMain4Binding viewDataBinding;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
//        LogUtils.eTag(Constant.TAG_NAV, "main3activity传来的数据 ： " + getIntent().getData().toString());
        viewDataBinding = DataBindingUtil.setContentView(this, R.layout.activity_main4);
        NbaBean nbaBean = new NbaBean("Kobe", "Paul");
        viewDataBinding.setNba(nbaBean);
        //取集合中的第几位
        viewDataBinding.setIndex(0);
        //集合
        ArrayList<String> strings = new ArrayList<>();
        strings.add("下一页");
        strings.add("上一页");
        viewDataBinding.setList(strings);
        viewDataBinding.setNextPage(true);
        viewDataBinding.setTestString("2");
        navigationTest();

        sendBroadcast(new Intent(Main3Activity.ACTION));

        viewDataBinding.btNext.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Main5Activity.launcher(Main4Activity.this);
            }
        });
    }

    private void navigationTest() {

    }

    @Override
    public boolean onSupportNavigateUp() {
        return Navigation.findNavController(this, R.id.fragment_navgation_test).navigateUp();
    }


}